package parsers.tests;

import java.io.File;
import java.util.List;
import parsers.CSVParser;
import junit.framework.Assert;
import junit.framework.TestCase;

public class CSVTest extends TestCase
{
    private CSVParser myParser;

    protected void setUp() throws Exception
    {
        super.setUp();
        myParser = new CSVParser();
    }

    protected void tearDown() throws Exception
    {
        super.tearDown();
    }

    public void testParseFile()
    {
        File file = new File("data/2DTestData");
        List<List<String>> result = myParser.parseFile(file);
        Assert.assertEquals(5, result.size());
        Assert.assertEquals(2, result.get(0).size());
        Assert.assertEquals("steve", result.get(2).get(0));
        Assert.assertEquals("6.0", result.get(3).get(1));
        Assert.assertEquals("Delilah", result.get(4).get(0));
    }

}
